package com.mantru.iotpot.job;

/**
 * 单个任务结点类
 */
public class JobNode {
    //结点类型，0开始时固定执行的指令、1结束时固定执行的指令、2常规指令
    public int node_type;
    //步骤序号，从1开始
    public int steep_index;
    //从站地址号，这里固定填0x01
    public int slave;
    //功能码，读0x03，写0x06
    public int function_code;
    //读取寄存器起始地址 / 写入寄存器地址 / 写入寄存器起始地址，这里是指原始地址，不用加上偏移地址(300)
    public int starting_address;
    //读取寄存器个数 / 写入寄存器个数
    public int quantity_of_x;
    //需要写入单个寄存器的数值
    public int output_value;
    //该寄存器在任务结束、暂停、停止时是否需要恢复原始值，true是需要
    public boolean is_need_init;
    //当is_need_init=true时的原始值
    public int init_value;
    //是发送指令后多少ms就触发关闭指令，关闭指令是指发init_value
    public int timer_trigger_value;

    public JobNode(int node_type, int steep_index, int slave, int function_code, int starting_address, int quantity_of_x, int output_value, boolean is_need_init, int init_value, int timer_trigger_value){
        this.node_type = node_type;
        this.steep_index = steep_index;
        this.slave = slave;
        this.function_code = function_code;
        this.starting_address = starting_address;
        this.quantity_of_x = quantity_of_x;
        this.output_value = output_value;
        this.is_need_init = is_need_init;
        this.init_value = init_value;
        this.timer_trigger_value = timer_trigger_value;
    }


}


